const mock = {
  "POST /api/flow-platform/model/list": (req, res) => {
    setTimeout(() => {
      if (req.query.type === "error") {
        res.status(200).json({
          errCode: "-1",
          errMsg: "连接数据库错误啦",
          datas: "",
        });
      } else {
        res.status(200).json({
          errCode: 0,
          totalCount: 30,
          datas: [
            {
              modelId: '1',
              modelName: 'API发布流程',
              version: '版本V1.0',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '2',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '3',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '4',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '5',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '6',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '7',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '8',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '9',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '10',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
            {
              modelId: '11',
              modelName: 'API发布流程',
              version: '版本',
              modelKey: '流程编码',
              appName: '所属应用1',
              createTime: '2017-07-05  13:34:23',
              creatorName: '创建人',
            },
          ],
        });
      }
    }, 2000);
  },
  "POST /api/flow-platform/model/create": (req, res) => {
    setTimeout(() => {
      res.status(200).json({
        errCode: 0,
        errMsg: '创建成功',
        datas: {
          modelId: 2345,
        },
      });
    }, 2000);
  },
  "POST /api/flow-platform/model/delete": (req, res) => {
    setTimeout(() => {
      res.status(200).json({
        errCode: 0,
        errMsg: '创建成功',
        datas: {
        },
      });
    }, 2000);
  },
  "GET /api/flow-platform/model/detail": (req, res) => {
    setTimeout(() => {
      res.status(200).json({
        errCode: 0,
        errMsg: '创建成功',
        datas: {
          "name": "流程模型00002",
          "description": "流程模型00002",
          "revision": 1,
          "modelId": "20001",
          "modelJson": {
            "modelId": "20001",
            "bounds": null,
            "properties": {
              "process_id": "moxing-10086",
              "name": "流程模型10086",
              "documentation": "流程模型00002",
              "process_author": "",
              "process_version": "",
              "process_namespace": "http://www.flowable.org/processdef",
              "process_historylevel": "",
              "isexecutable": true,
              "dataproperties": "",
              "executionlisteners": "",
              "eventlisteners": "",
              "signaldefinitions": "",
              "messagedefinitions": "",
              "process_potentialstarteruser": "",
              "process_potentialstartergroup": "",
              "iseagerexecutionfetch": "false",
            },
            "nodes": [
              { "shape": "StartNoneEvent", "type": "node", "size": "32*32", "label": "开始", "color": "#a5e181", "x": 49, "y": 90, "id": "e9a00bf2", "style": { "fill": "#fff", "stroke": "#a5e181" }, "model": { "resourceId": "e9a00bf2", "properties": { "overrideid": "", "name": "开始", "documentation": "", "executionlisteners": "", "initiator": "", "formkeydefinition": "", "formreference": "", "formproperties": {} }, "stencil": { "id": "StartNoneEvent" } }, "index": 0 },
              { "shape": "IncludeGateway", "type": "node", "size": "38*38", "label": "包含网关", "color": "#fff", "x": 150, "y": 90, "id": "a720c253", "style": { "fill": "#fff", "stroke": "#fff" }, "model": { "resourceId": "a720c253" }, "index": 2 },
              { "shape": "UserTask", "type": "node", "size": "120*60", "label": "用户任务", "color": "#FFBB95", "x": 302, "y": 27, "id": "eca75bdc", "style": { "fill": "#fff", "stroke": "#FFBB95" }, "model": { "resourceId": "0668deb2", "properties": { "overrideid": "", "name": "", "documentation": "", "asynchronousdefinition": "false", "exclusivedefinition": "false", "executionlisteners": "", "multiinstance_type": "None", "multiinstance_cardinality": "", "multiinstance_collection": "", "multiinstance_variable": "", "multiinstance_condition": "", "isforcompensation": "false", "usertaskassignment": "", "formkeydefinition": "", "formreference": "", "duedatedefinition": "", "prioritydefinition": "", "formproperties": "", "tasklisteners": "", "skipexpression": "", "categorydefinition": "" }, "stencil": { "id": "UserTask" } }, "index": 3 },
              { "shape": "UserTask", "type": "node", "size": "120*60", "label": "用户任务", "color": "#FFBB95", "x": 304, "y": 144, "id": "0668deb2", "style": { "fill": "#fff", "stroke": "#FFBB95" }, "model": { "resourceId": "0668deb2", "properties": { "overrideid": "", "name": "", "documentation": "", "asynchronousdefinition": "false", "exclusivedefinition": "false", "executionlisteners": "", "multiinstance_type": "None", "multiinstance_cardinality": "", "multiinstance_collection": "", "multiinstance_variable": "", "multiinstance_condition": "", "isforcompensation": "false", "usertaskassignment": "", "formkeydefinition": "", "formreference": "", "duedatedefinition": "", "prioritydefinition": "", "formproperties": "", "tasklisteners": "", "skipexpression": "", "categorydefinition": "" }, "stencil": { "id": "UserTask" } }, "index": 4 },
              { "shape": "IncludeGateway", "type": "node", "size": "38*38", "label": "包含网关", "color": "#fff", "x": 441, "y": 89.5, "id": "74bd2753", "style": { "fill": "#fff", "stroke": "#fff" }, "model": { "resourceId": "74bd2753" }, "index": 7 },
              { "shape": "EndNoneEvent", "type": "node", "size": "32*32", "label": "结束", "color": "#fbeeee", "x": 556.5, "y": 89.5, "id": "dd802939", "style": { "fill": "#fff", "stroke": "#f10000" }, "model": { "resourceId": "dd802939", "properties": { "overrideid": "", "name": "", "documentation": "", "executionlisteners": "" }, "stencil": { "id": "EndNoneEvent" } }, "index": 11 },
            ],
            "edges": [
              { "shape": "flow-polyline-round", "source": "e9a00bf2", "sourceAnchor": 3, "target": "a720c253", "targetAnchor": 2, "style": {}, "id": "7dcde9b3", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 1 },
              { "shape": "flow-polyline-round", "source": "a720c253", "sourceAnchor": 0, "target": "eca75bdc", "targetAnchor": 2, "style": {}, "id": "5bd31d47", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 5 },
              { "shape": "flow-polyline-round", "source": "a720c253", "sourceAnchor": 1, "target": "0668deb2", "targetAnchor": 2, "style": {}, "id": "f23dfe4c", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 6 },
              { "shape": "flow-polyline-round", "source": "eca75bdc", "sourceAnchor": 3, "target": "74bd2753", "targetAnchor": 0, "style": {}, "id": "62dba486", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 8 },
              { "shape": "flow-polyline-round", "source": "0668deb2", "sourceAnchor": 3, "target": "74bd2753", "targetAnchor": 1, "style": {}, "id": "43701fef", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 9 },
              { "shape": "flow-polyline-round", "source": "74bd2753", "sourceAnchor": 3, "target": "dd802939", "targetAnchor": 2, "style": {}, "id": "393c1564", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 10 },
            ],
          },
        },
      });
    }, 2000);
  },
  "GET /flow-platform/process": (req, res) => {
    setTimeout(() => {
      res.status(200).json({
        errCode: 0,
        errMsg: '',
        datas: {
          process: {
            modelName: '流程模型00002',
            applyUserName: 'admin',
            appName: '单方',
            busiName: '奋斗故事',
            taskName: '讽德诵功人',
            applyTime: '2019-01-22 10:37:20',
            createTime: '2019-01-22 10:37:20',
            processInstanceId: '32149',
            taskId: '321432',
          },
          model: {
            nodes: [
              { "shape": "StartNoneEvent", "type": "node", "size": "32*32", "label": "开始", "color": "#a5e181", "x": 49, "y": 90, "id": "e9a00bf2", "style": { "fill": "#fff", "stroke": "#a5e181" }, "model": { "resourceId": "e9a00bf2", "properties": { "overrideid": "", "name": "开始", "documentation": "", "executionlisteners": "", "initiator": "", "formkeydefinition": "", "formreference": "", "formproperties": {} }, "stencil": { "id": "StartNoneEvent" } }, "index": 0 },
              { "shape": "IncludeGateway", "type": "node", "size": "38*38", "label": "包含网关", "color": "#fff", "x": 150, "y": 90, "id": "a720c253", "style": { "fill": "#fff", "stroke": "#fff" }, "model": { "resourceId": "a720c253" }, "index": 2 },
              { "shape": "UserTask", "type": "node", "size": "120*60", "label": "用户任务", "color": "#FFBB95", "x": 302, "y": 27, "id": "eca75bdc", "style": { "fill": "#fff", "stroke": "#FFBB95" }, "model": { "resourceId": "0668deb2", "properties": { "overrideid": "", "name": "", "documentation": "", "asynchronousdefinition": "false", "exclusivedefinition": "false", "executionlisteners": "", "multiinstance_type": "None", "multiinstance_cardinality": "", "multiinstance_collection": "", "multiinstance_variable": "", "multiinstance_condition": "", "isforcompensation": "false", "usertaskassignment": "", "formkeydefinition": "", "formreference": "", "duedatedefinition": "", "prioritydefinition": "", "formproperties": "", "tasklisteners": "", "skipexpression": "", "categorydefinition": "" }, "stencil": { "id": "UserTask" } }, "index": 3 },
              { "shape": "UserTask", "type": "node", "size": "120*60", "label": "用户任务", "color": "#FFBB95", "x": 304, "y": 144, "id": "0668deb2", "style": { "fill": "#fff", "stroke": "#FFBB95" }, "model": { "resourceId": "0668deb2", "properties": { "overrideid": "", "name": "", "documentation": "", "asynchronousdefinition": "false", "exclusivedefinition": "false", "executionlisteners": "", "multiinstance_type": "None", "multiinstance_cardinality": "", "multiinstance_collection": "", "multiinstance_variable": "", "multiinstance_condition": "", "isforcompensation": "false", "usertaskassignment": "", "formkeydefinition": "", "formreference": "", "duedatedefinition": "", "prioritydefinition": "", "formproperties": "", "tasklisteners": "", "skipexpression": "", "categorydefinition": "" }, "stencil": { "id": "UserTask" } }, "index": 4 },
              { "shape": "IncludeGateway", "type": "node", "size": "38*38", "label": "包含网关", "color": "#fff", "x": 441, "y": 89.5, "id": "74bd2753", "style": { "fill": "#fff", "stroke": "#fff" }, "model": { "resourceId": "74bd2753" }, "index": 7 },
              { "shape": "EndNoneEvent", "type": "node", "size": "32*32", "label": "结束", "color": "#fbeeee", "x": 556.5, "y": 89.5, "id": "dd802939", "style": { "fill": "#fff", "stroke": "#f10000" }, "model": { "resourceId": "dd802939", "properties": { "overrideid": "", "name": "", "documentation": "", "executionlisteners": "" }, "stencil": { "id": "EndNoneEvent" } }, "index": 11 },
            ],
            edges: [
              { "shape": "flow-polyline-round", "source": "e9a00bf2", "sourceAnchor": 3, "target": "a720c253", "targetAnchor": 2, "style": {}, "id": "7dcde9b3", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 1 },
              { "shape": "flow-polyline-round", "source": "a720c253", "sourceAnchor": 0, "target": "eca75bdc", "targetAnchor": 2, "style": {}, "id": "5bd31d47", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 5 },
              { "shape": "flow-polyline-round", "source": "a720c253", "sourceAnchor": 1, "target": "0668deb2", "targetAnchor": 2, "style": {}, "id": "f23dfe4c", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 6 },
              { "shape": "flow-polyline-round", "source": "eca75bdc", "sourceAnchor": 3, "target": "74bd2753", "targetAnchor": 0, "style": {}, "id": "62dba486", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 8 },
              { "shape": "flow-polyline-round", "source": "0668deb2", "sourceAnchor": 3, "target": "74bd2753", "targetAnchor": 1, "style": {}, "id": "43701fef", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 9 },
              { "shape": "flow-polyline-round", "source": "74bd2753", "sourceAnchor": 3, "target": "dd802939", "targetAnchor": 2, "style": {}, "id": "393c1564", "model": { "resourceId": "393c1564", "properties": { "overrideid": "", "name": "", "documentation": "", "conditionsequenceflow": "", "executionlisteners": "", "defaultflow": "false", "skipexpression": "" }, "stencil": { "id": "SequenceFlow" } }, "index": 10 },
            ],
          },
          taskLog: [
            {
              taskId: '1',
              endTime: '2019-01-23 10:37:20',
              taskName: '科长审批',
              assignee: '路由',
              handleDetail: {
                approval: 'pass',
                comment: '同意',
              },
            },
            {
              taskId: '2',
              endTime: '2019-01-24 10:37:20',
              taskName: '组长审批',
              assignee: '瑞丰',
              handleDetail: {
                approval: 'unpass',
                comment: '不同意',
              },
            },
          ],
        },
      });
    }, 2000);
  },
};
module.exports = mock;
